export default class CheckerboardController {
    constructor($uibModal, config,  goService) {
        this.title = 'qp';
        this.$uibModal = $uibModal;
        this.config = config;
        this.goService = goService;
        this.init();
    }
    init(){
        this.coordinate = {};
        this.xs = [];
        this.ys = [];
        this.drawCheckerboard()
    }

    drawCheckerboard(){
        var canvas=document.getElementById('myCanvas');
        var ctx=canvas.getContext('2d');
        ctx.beginPath();
        let x = 10, y = 10, length = 570, spacing = 30, count = 19;
        //横线
        for(let i = 0; i <= count; i ++){
            ctx.moveTo(x, y + (i * spacing));
            ctx.lineTo(x + length, y + (i * spacing));
        }
        //竖线
        for(let i = 0; i <= count; i ++){
            ctx.moveTo(x + (i * spacing), y);
            ctx.lineTo(x + (i * spacing), y + length);
        }



        ctx.stroke();
    }
    drawCheckerboardPoint(){//点

    }
    drawCheckerboardLine(){//线

    }

    drawCheckerboardPlane(){//面

    }



    show(order) {
        //let modalInstance = this.$uibModal.open({
        //    template: OrderDetailTemplate,
        //    controller: OrderDetailController,
        //    bindToController: true,
        //    controllerAs: ControllerName,
        //    size: 'lg',
        //    resolve: {
        //        order,
        //        guides: () => this.guides,
        //        title: () => '修改订单',
        //        service: () => this.ordersService
        //    }
        //});
        //
        //modalInstance.result.then(
        //        flag => {
        //        if (flag === 'updated') {
        //            this.ordersService.getOrders().then(
        //                    orders => { this.orders = orders; }
        //            );
        //        }
        //    }
        //);
    }
}

CheckerboardController.$inject = ['$uibModal', 'config', 'goService'];
